package com.whmw.mybatisplusdemo.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 枚举
 */
@Getter
@AllArgsConstructor
public enum GenderEnum {
    MALE("M", "男性"),
    FEMALE("F", "女性");

    @EnumValue // 数据库中实际存储的值
    private final String code;

    @JsonValue // 序列化时返回给前端的值
    private final String desc;

}